<?php
namespace app\api\controller;


use app\common\controller\Base;
use app\common\service\ArchivesService;
use \think\Input;

class Archives extends Base{
    /**
     * 获取文档
     */
    public function getArchives(){
        $aid = Input::get('aid');
        if(empty($aid)){
            //没有传入$aid
            return $this->errorApi('没有传入aid');
        }
        //创建文档服务类
        $archivesService = new ArchivesService();
        $archives = $archivesService->get($aid);
        if( empty($archives) ){
            //没有找到该文档
            return $this->errorApi('没有找到该文档');
        }
        return $archives;
    }
}